import 'package:ai_desktop_eidtor/models/hive_models.dart';
import 'package:ai_desktop_eidtor/util/y_req.dart';
import 'package:get/get.dart';

import '../../models/BookChapterRepository.dart';
import 'book_state.dart';

class BookLogic extends GetxController {
  final BookState state = BookState();

  List<BookModel> dataArr = [];
  @override
  void onReady() {
    // TODO: implement onReady
    super.onReady();

    loadAllBook();
  }

  void loadAllBook() async {
    yGet(load: (repository) async{
      dataArr = await repository.getAllBooks();
      update();
    });
  }
}
